﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UFTClose.aspx.cs" Inherits="UFTClose"
    MasterPageFile="~/Default.master" EnableViewState="false" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
    
<asp:Content ContentPlaceHolderID="head" ID="hd" runat="server" EnableViewState="false">

    <script src="UFTClose.js" type="text/javascript"></script>
    <script src="js/LOV.js" type="text/javascript"></script>

    <script src="js/Ajax.js" type="text/javascript"></script>
	<script src="js/FileUpload.js" type="text/javascript"></script>
    <%--

    <script src="js/Datetimepicker.js" type="text/javascript"></script>
    <!-- TinyMCE -->

    <script src="js/tiny_mce.js" type="text/javascript"></script>

    <!-- /TinyMCE -->--%>
    <link href="UFTClose.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="leftMenu" ID="leftnav" runat="server" EnableViewState="false">
<% Response.Write(GenerateSideMenu()); %>

</asp:Content>
<asp:Content ContentPlaceHolderID="content" ID="ctnUFTGuest" runat="server"
    EnableViewState="false">
    <div id="pnlUFTGuestTitle">
    </div>
    <div id="pnl_UFTGuest" runat="server">
            </div>
     <fieldset class="m_fs_border" id="fs_UFTNew">
        <legend>
            <a class="lnk" href="javascript:toggle('UFTNew');">
            <%if (bCheckClose)
              {
                  %>Event Details (This Event has been CLOSED)<%
              }
              else
              {
                  %>Event Details<%
              } %>
                </a>
        </legend>
        <dl class="m_fs">
            <div id="div_UFTNew">
            <% 
            if (m_iEventId > 0)
            {
                Response.Write(m_uftData.BuildFieldSet_UFTData());
            }
            if ((ICPUser.IsAdmin || ICPUser.IsAdminForum))
            {
                Response.Write(UFTManager.BuildEditor_LastMinuteGuest());
            %>
            <hr />
            <%
            }
            %>
            <%--<br />--%> 
            <%--<%if (!bSaved)
              { %>--%>
                <div id="lnkCheckAll" class="lnk" onclick="checkAll();" >check</div>
                &nbsp;
                <div id="lnkUncheckAll" class="lnk" onclick="uncheckAll();" >uncheck</div> 
           <%-- <%  } %> --%>           
                <input type="hidden" id="hfSave" />
            <dxwgv:ASPxGridView ID="dgCustomerList" KeyFieldName="T_RELATION_INVITATION_ID" 
                    ClientInstanceName="dgCustomerList_c" runat="server"
                    AutoGenerateColumns="true" Width="100%" Font-Size="Small" 
                    OnCustomCallback="dgCustomerList_CustomCallback">
                    <Styles Cell-HorizontalAlign="Left" Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" Cell-Font-Size="Smaller" Header-Wrap="true" Header-Font-Size="Smaller" Header-Font-Bold="true">
                    <Header Wrap="True" Font-Size="Smaller" Font-Bold="True"></Header>
                    <AlternatingRow Enabled="True"></AlternatingRow>
                    <Cell Wrap="True" Font-Size="Smaller"></Cell>
                    </Styles>
                    <SettingsPager PageSize="10"></SettingsPager>
                    <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" />
                    <SettingsBehavior AllowSort="true"/>
                    <Columns>
                    <dxwgv:GridViewCommandColumn ShowSelectCheckbox="true" Width="5%" Caption="#">
                    </dxwgv:GridViewCommandColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="T_RELATION_INVITATION_ID" Name="T_RELATION_INVITATION_ID"/>
                    <dxwgv:GridViewDataTextColumn FieldName="CUSTOMER_ID" Name="CUSTOMER_ID" Caption="CUSTOMER ID" />
                    <dxwgv:GridViewDataTextColumn FieldName="COMPANY_NAME" Name="COMPANY_NAME" Caption="COMPANY NAME" >
                        <DataItemTemplate>
                        <%# GridColumnManager.GetCompanyLinkColumn(Eval("CUSTOMER_ID").ToString(), Eval("COMPANY_NAME").ToString())%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="TOTAL_GUEST" Name="TOTAL_GUEST" Caption="TOTAL GUEST" />
                    <dxwgv:GridViewDataTextColumn Caption="#" Name="INVITE" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                            <%# GetInviteColumn(Eval("T_RELATION_INVITATION_ID").ToString(), Eval("CUSTOMER_ID").ToString())%>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="STATUS_HADIR" Name="STATUS_HADIR" Caption="STATUS HADIR" />
                    <dxwgv:GridViewDataTextColumn FieldName="ALASAN_TIDAK_HADIR" Name="ALASAN_TIDAK_HADIR" Caption="ALASAN TIDAK HADIR" >
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="#" FieldName="NOT_ATTEND" Name="NOT_ATTEND" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                        <%# UFTManager.GetConfirmColumn(Eval("T_RELATION_INVITATION_ID").ToString(), Eval("STATUS_HADIR").ToString())%>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    </Columns>
                    <ClientSideEvents EndCallback="function(s, e) { dgCustomerList_c_CallbackComplete(); }" />
            </dxwgv:ASPxGridView>
                <%--<%if (!bSaved)
                  { %>--%>
               <input type="button" id="btnSave" class="btn" value="save" onclick="DoSave();" 
                style="float: right; margin-left: 5px;" />   
                
                <%--<%} %>--%>
            
            <div id="load" style="float: right; padding-right: 10px;">
            </div>
        </dl> 
        </fieldset>
        <dxcb:ASPxCallback ID="cbkConfirm" ClientInstanceName="cbkConfirm_c" runat="server" OnCallback="cbkConfirm_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkConfirm_c_CallbackComplete(e); }" />
        </dxcb:ASPxCallback>
        
        <% 
         if (m_iEventId > 0 && !bCheckClose)
         {   %>
        <fieldset class="m_fs_border" id="fs_UFTClose">
        <legend>
            <a class="lnk" href="javascript:toggle('UFTClose');">
                Close this event</a>
        </legend>
        <dl class="m_fs">
            <div id="div_UFTClose">
            <% 
                    Response.Write(m_uftData.BuildEditor_CloseEvent());
            %> 
                <input type="button" id="btnClose" class="btn" style="float: right; margin-left: 5px;"
                 onclick="DoClose();" value="Close" />
            </div>
        </dl> 
        </fieldset>   
    <% }  %>
    <dxcb:ASPxCallback ID="cbkClose" ClientInstanceName="cbkClose_c" runat="server" OnCallback="cbkClose_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkClose_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
    <div id="popupGuest" class="m_popuplayer">
        <div id="pop" class="popLOV2">
            <div id="lnkUncheckAllGuest" class="lnk" onclick="uncheckAllGuest();" style="float:right;margin-left: 5px;">uncheck</div>
            &nbsp;
            <div id="lnkCheckAllGuest" class="lnk" onclick="checkAllGuest();" style="float:right;margin-left: 5px;">check</div>
            <input type="hidden" id="hfCompID" />
            <input type="hidden" id="hfInvID" />
            Contact Person List
                <dxwgv:ASPxGridView ID="dgGuest" KeyFieldName="ID" 
                        ClientInstanceName="dgGuest_c" runat="server"
                        AutoGenerateColumns="true" Width="100%" Font-Size="Small" 
                        OnCustomCallback="dgGuest_CustomCallback">
                        <Styles Cell-HorizontalAlign="Left" Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" Cell-Font-Size="Smaller" Header-Wrap="true" Header-Font-Size="Smaller" Header-Font-Bold="true">
                        <Header Wrap="True" Font-Size="Smaller" Font-Bold="True"></Header>
                        <AlternatingRow Enabled="True"></AlternatingRow>
                        <Cell Wrap="True" Font-Size="Smaller"></Cell>
                        </Styles>
                        <SettingsPager PageSize="5"></SettingsPager>
                        <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" />
                        <SettingsBehavior AllowSort="true"/>
                        <Columns>
                        <dxwgv:GridViewCommandColumn Caption="UNDANG" ShowSelectCheckbox="true" Width="25"/>
                        <dxwgv:GridViewDataTextColumn FieldName="ID" Name="ID" Visible="false"/>
                        <dxwgv:GridViewDataTextColumn FieldName="ID_COMBINED" Name="ID_COMBINED" Visible="false"/>
                        <dxwgv:GridViewDataTextColumn FieldName="NAME" Name="NAME" Caption="NAME" />
                        <dxwgv:GridViewDataTextColumn FieldName="GENDER" Name="GENDER" Caption="GENDER" />
                        <dxwgv:GridViewDataTextColumn FieldName="EMAIL" Name="EMAIL" Caption="EMAIL" />
                        <dxwgv:GridViewDataTextColumn FieldName="PHONE" Name="PHONE" Caption="PHONE" />
                        <dxwgv:GridViewDataTextColumn FieldName="CELLPHONE" Name="CELLPHONE" Caption="CELLPHONE" />
                        <dxwgv:GridViewDataTextColumn FieldName="POSITION" Name="POSITION" Caption="POSITION" />
                        </Columns>
                        <ClientSideEvents EndCallback="function(s, e) { dgGuest_c_CallbackComplete(); }" />
                </dxwgv:ASPxGridView>
                <input type="button" id="btnSelect" class="btn" value="select" onclick="DoSelectGuest();" 
                    style="float: right; margin-left: 5px;" /> 
                    Selected Guest
                <dxwgv:ASPxGridView ID="dgGuestSelected" KeyFieldName="ID" 
                            ClientInstanceName="dgGuestSelected_c" runat="server"
                            AutoGenerateColumns="true" Width="100%" Font-Size="Small" 
                            OnCustomCallback="dgGuestSelected_CustomCallback">
                            <Styles Cell-HorizontalAlign="Left" Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" Cell-Font-Size="Smaller" Header-Wrap="true" Header-Font-Size="Smaller" Header-Font-Bold="true">
                            <Header Wrap="True" Font-Size="Smaller" Font-Bold="True"></Header>
                            <AlternatingRow Enabled="True"></AlternatingRow>
                            <Cell Wrap="True" Font-Size="Smaller"></Cell>
                            </Styles>
                            <SettingsPager PageSize="5"></SettingsPager>
                            <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" />
                            <SettingsBehavior AllowSort="true"/>
                            <Columns>
                            <dxwgv:GridViewDataTextColumn FieldName="ID" Name="ID" Visible="false"/>
                            <dxwgv:GridViewDataTextColumn FieldName="ID_COMBINED" Name="ID_COMBINED" Visible="false"/>
                            <dxwgv:GridViewDataTextColumn FieldName="NAME" Name="NAME" Caption="NAME" />
                            <dxwgv:GridViewDataTextColumn FieldName="GENDER" Name="GENDER" Caption="GENDER" />
                            <dxwgv:GridViewDataTextColumn FieldName="EMAIL" Name="EMAIL" Caption="EMAIL" />
                            <dxwgv:GridViewDataTextColumn FieldName="PHONE" Name="PHONE" Caption="PHONE" />
                            <dxwgv:GridViewDataTextColumn FieldName="CELLPHONE" Name="CELLPHONE" Caption="CELLPHONE" />
                            <dxwgv:GridViewDataTextColumn FieldName="POSITION" Name="POSITION" Caption="POSITION" />
                            </Columns>
                            <ClientSideEvents EndCallback="function(s, e) { dgGuestSelected_c_CallbackComplete(); }" />
                    </dxwgv:ASPxGridView>
                <input type="button" id="btnCancel" class="btn" value="close" onclick="DoCancelGuest();" 
                    style="float: right; margin-left: 5px;" />  
                <%--<input type="button" id="btnSave" class="btn" value="save" onclick="DoSaveGuest();" 
                    style="float: right; margin-left: 5px;" /> --%> 
        </div>
    </div>
</asp:Content>
